package com.sixth.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sixth.entity.Zone;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public interface ZoneDao extends BaseMapper<Zone> {
    int deleteByPrimaryKey(String id);

    int insert(Zone record);

    int insertSelective(Zone record);

    Zone selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(Zone record);

    int updateByPrimaryKey(Zone record);

    List<Zone> selectZoneByCondition(@Param("zoneName") String zoneName,@Param("isDeleted") Integer isDeleted);

    int addZone(@Param("id") String id,@Param("zone") Zone zone);

    int changeStatusByid(@Param("id") String id,@Param("isDisable") Integer isDisable);


    @Update("update tb_zone set is_disable=#{isdisable},zone_name=#{zonename},zone_desc=#{zonedesc} where id=#{id}")
    int updateByIdd(String id, String isdisable, String zonedesc, String zonename);

    @Update("update tb_zone set is_disable=#{isdisable} where id=#{id}")
    int updateIsDisable(String id, Integer isdisable);

    @Insert("insert into tb_zone(id,is_disable,zone_name,zone_desc) values(#{id},0,#{zonename},#{zonedesc})")
    int insertOrder(@Param("id") String id,@Param("zonename") String zonename,@Param("zonedesc") String zonedesc);

}